﻿{include file="public/header"}

<title>订单列表</title>
</head>
<style>
    .layui-layer-page .layui-layer-content {
        overflow: visible !important;
    }

</style>
<body>
<nav class="breadcrumb">

    <a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px"
       href="javascript:location.replace(location.href);" title="刷新"><i class="Hui-iconfont">&#xe68f;</i></a>
</nav>
<div class="page-container">
    <form method="get">

        <div class="text-c "><span class="select-box inline" style="border: none">
                      <span class="select-box inline" style="border: none">
                	<select name="order_timeType" class="form-control">
			<option value="" >时间筛选</option>
            <option value="1"  <?php if( isset($data['order_timeType']) && $data["order_timeType"]==1){?> selected="selected" <?php }?>>录入时间</option>
            <option value="2" <?php if( isset($data['order_timeType']) && $data["order_timeType"]==2){?> selected="selected" <?php }?>>签约时间</option>
            <option value="3"  <?php if( isset($data['order_timeType']) && $data["order_timeType"]==3){?> selected="selected" <?php }?>>开工时间</option>
            <option value="4"  <?php if( isset($data['order_timeType']) && $data["order_timeType"]==4){?> selected="selected" <?php }?>>完工时间</option>
            <option value="5"  <?php if( isset($data['order_timeType']) && $data["order_timeType"]==5){?> selected="selected" <?php }?>>完款时间</option>
            <option value="6"  <?php if( isset($data['order_timeType']) && $data["order_timeType"]==6){?> selected="selected" <?php }?>>结算时间</option>
        </select>
            </span>

            <input type="text" name="start_time" id="countTimestart" onfocus="selecttime(1)" size="17"
                   class="date input-text " readonly style="width:100px"
                   value="{$data['start_time'] ?? ''}">
            -
            <input type="text" name="end_time" id="countTimeend" onfocus="selecttime(2)" size="17"
                   class="date input-text" readonly style="width:100px"
                   value="{$data['end_time'] ?? ''}">
<!--<span class="select-box inline" style="border: none">-->
		 <!--<select name="city_id" class="form-control" style="float: left;width: 40%;padding: 3px">-->
                <!--<option value="">搜索城市</option>-->
<!--<option value="" >选择城市</option>-->
                <!--{volist name='city' id='v'}-->
                <!--<option value="{$v.city_id}" <?php if( isset($data['city_id']) && $data["city_id"]==$v['city_id']){?> selected="selected" <?php }?> >{$v.city}</option>-->
                <!--{/volist}-->
            <!--</select>-->
            <!--<input type="text" name="assignor" placeholder="接单人" style="width:128px" class="input-text  form-control" value="{$data['assignor'] ?? ''}">-->
            <!--</span>-->
            <span class="select-box inline">
		<select name="order_store" class="select">
			<option value="" selected>分店</option>
            {volist name='store' id='v'}
            <option value="{$v.store_id}"  <?php if( isset($data['order_store']) && $data["order_store"]==$v['store_id']){?> selected="selected" <?php }?>>{$v.store_name}</option>
       {/volist}

		</select>
                	</span>
            <span class="select-box inline">
		<select name="channel_id" class="select">
			<option value="" selected>订单渠道</option>
            {volist name='p' id='v'}
            <option value="{$v.id}" <?php if( isset($data['channel_id']) && $data["channel_id"]==$v['id']){?> selected="selected" <?php }?>>{$v.title}</option>
       {/volist}

		</select>


		</span>
            <span class="select-box inline">
		<select name="channel_details" class="select">
			<option value="" selected>订单渠道二级</option>
            {volist name='channel_details' id='v'}
            <option value="{$v.id}" <?php if( isset($data['channel_details']) && $data["channel_details"]==$v['id']){?> selected="selected" <?php }?>>{$v.title}</option>
       {/volist}

		</select>


		</span>
            <span class="select-box inline">
		<select name="residential_id" class="select">
			<option value="" selected>物业公司</option>
            {volist name='l' id='v'}
            <option value="{$v.username}" <?php if(isset($data['group_id']) && $data["group_id"]==$v['username']){?> selected="selected" <?php }?> >{$v.username}</option>
       {/volist}

		</select>


		</span>
            <button class="btn btn-success" type="submit"><i class="Hui-iconfont">&#xe665;</i> 搜索</button>

    </div>
    </form>
    {if condition="$node.rule=='*' || $admin.admin_id==4 || $admin.admin_id ==68 || $admin.admin_id==43 ||
    $admin.export==1"}

    <a href="{:Url('index/Export/order_list')}?start_time={$data['start_time'] ?? ''}&end_time={$data['end_time'] ?? ''}&order_timeType={$data['order_timeType'] ?? ''}&city_id={$data['city_id'] ?? ''}&assignor={$data['assignor'] ?? ''}&order_store={$data['order_store'] ?? ''}&channel_id={$data['channel_id'] ?? ''}&channel_details={$data['channel_details'] ?? ''}&residential_id={$data['residential_id'] ?? ''}" style="text-decoration:none" class="ml-5 dao" title="导出"><span
            class="label label-primary">导出</span></a>
    {/if}
    <div class="mt-20">
        <div class="title-border" style="font-size: 13px">
            <div class="flex10">订单编号</div>
            <div class="flex10">签约时间</div>

            <div class="flex10">录入时间</div>
            <div class="flex7">城市</div>
            <div class="flex10">店长姓名</div>
            <div class="flex7">店铺</div>
            <div class="flex10">物业</div>
            <div class="flex7 ">管家</div>
            <div class="flex10">小区</div>
            <div class="flex10">录入人员</div>
            <div class="flex7">微信</div>
            <div class="flex10">渠道</div>
            <div class="flex10">二级渠道</div>
            <div class="flex8">订单状态</div>
            <div class="flex10">房屋问题</div>
            <div class="flex10">二级分类</div>
            <div class="flex10">客户名称</div>
            {if condition="$hide == 2"}
            <div class="flex10">客户电话</div>
            {/if}
            <div class="flex15">项目地址</div>
            <div class="flex10">开工时间</div>
            <div class="flex10">完工时间</div>
            <div class="flex10">签单金额</div>
            <div class="flex7">收款金额</div>

        </div>
        {volist name='list' id='vo'}
        <div class="content-border" style="font-size: 12px">
            <div class="flex10">{$vo.order_no}</div>
            <div class="flex10">{$vo.signing_time}</div>

            <div class="flex10">{$vo.created_time}</div>
            <div class="flex7">{$vo.city}</div>
            <div class="flex10">{$vo.user_name}</div>
            <div class="flex7">{$vo.store}</div>
            <div class="flex10">{$vo.residential_name}</div>
            <div class="flex7">{$vo.management}</div>
            <div class="flex10">{$vo.residential_quarters}</div>
            <div class="flex10">{$vo.entry}</div>
            <div class="flex7">{$vo.wechat}</div>
            <div class="flex10">{$vo.chanel_title}</div>
            <div class="flex10">{$vo.channel_details_title}</div>
            <div class="flex8">{$vo.state}</div>
            <div class="flex10">{$vo.order_question}</div>
            <div class="flex10">{$vo.category_title1}</div>
            <div class="flex10">{$vo.contacts}</div>
            {if condition="$hide == 2"}
            <div class="flex10">{$vo.mobile}</div>
            {/if}
            <div class="flex15">{$vo.address}</div>
            <div class="flex10">{$vo.start_time}</div>
            <div class="flex10">{$vo.finish_time}</div>
            <div class="flex10">{$vo.turnover}</div>
            <div class="flex7">{$vo.payment}</div>

        </div>
        {/volist}


        <div class="pages" style="float: right">{$list->render()}</div>
    </div>


    {include file="public/footer"}
    <script type="text/javascript">


        function selecttime(flag) {
            if (flag == 1) {
                var endTime = $("#countTimeend").val();
                if (endTime != "") {
                    WdatePicker({dateFmt: 'yyyy-MM-dd', maxDate: endTime})
                } else {
                    WdatePicker({dateFmt: 'yyyy-MM-dd'})
                }
            } else if (flag == 2) {
                var startTime = $("#countTimestart").val();
                if (startTime != "") {
                    WdatePicker({dateFmt: 'yyyy-MM-dd', minDate: startTime})
                } else {
                    WdatePicker({dateFmt: 'yyyy-MM-dd'})
                }
            } else {
                WdatePicker({dateFmt: 'yyyy-MM-dd'})
            }
        }

        $('.page-container').on('click', '.info', function () {
            var id = $(this).attr('data-id');
            var src = "{:Url('index/order/info')}";
            var index = layer.open({
                type: 2,
                area: ['100%', '100%'],
                fix: false,
                shade: 0.4,
                title: '订单详情',
                content: src + '?order_id=' + id
            });
            layer.full(index);
        });

        $('.page-container').on('click', '.info1', function () {
            var id = $(this).attr('data-id');
            var src = "{:Url('index/Statistics/info')}";
            var index = layer.open({
                type: 2,
                area: ['100%', '100%'],
                fix: false,
                shade: 0.4,
                title: '订单详情',
                content: src + '?order_id=' + id
            });
            layer.full(index);
        });
        /**
         * 编辑
         */
        $('.page-container').on('click', '.edit', function () {
            var winWidth = $(window).width();
            var areaWidth = "";
            var areaHeight = "";
            if (winWidth > 768) {
                areaWidth = "800px"
                areaHeight = "600px"
            } else {
                areaWidth = '100%'
                areaHeight = '100%'
            }
            var id = $(this).attr('data-id');
            var src = "{:Url('index/order/edit')}";
            layer.open({
                type: 2,
                area: [areaWidth, areaHeight],
                scrollbar: false,//屏蔽浏览器滚动条
                shade: 0.4,
                title: '订单编辑',
                zIndex: layer.zIndex,
                content: src + '?order_id=' + id,
                success: function (layero, index) {
                    layer.iframeAuto(index);
                }
            });
        });

        /**
         * 导出
         */
        function downloadFile() {
            var dom = document.getElementById('ifile');
            dom.src = "{:Url('index/Statistics/download')}";
        }

    </script>

    <script>
        $(function () {
            for (var i = 0; i < $(".more").length; i++) {
                (function (index) {
                    $(".more").eq(index).on("click", function () {
                        console.log(123)
                        var moreStr = '';
                        $(".ch-more-content").html("");
                        var cont = $(".content-border").eq(index).children("div");
                        var tit = $(".title-border").children("div");
                        var contArr = [];
                        var titArr = [];
                        for (var j = 0; j < cont.length; j++) {
                            if (cont.eq(j).html() != "") {
                                contArr.push(cont.eq(j).html())
                                titArr.push(tit.eq(j).html())
                            }
                        }
                        titArr.splice(-1, 1);
                        contArr.splice(-2, 1);
                        for (var l = 0; l < titArr.length; l++) {
                            if (l != titArr.length - 1) {
                                moreStr += `
                            <div class="ch-more-row"><p>${titArr[l]}：</p><p>${contArr[l]}</p></div>
                            `
                            } else {
                                moreStr += `<div class="ch-more-row-button">${contArr[l]}</div>`
                            }
                        }
                        $(".ch-more-content").append(moreStr);
                        $(".ch-more").css({"opacity": "1", "z-index": "10000"});
                        $(".ch-more-white").css({
                            "transform": "scale(1)",
                            "margin-top": ($(window).height() - $(".ch-more-white").height()) / 2
                        });
                    })
                })(i)
            }
            $(".ch-more-off").on("click", function () {
                $(".ch-more").css({"opacity": "0", "z-index": "-1"});
                $(".ch-more-white").css("transform", "scale(0)");
            })
            $(".ch-more").on('click', '.ch-more-row-button a', function () {
                $(".ch-more").css({"opacity": "0", "z-index": "-1"});
                $(".ch-more-white").css("transform", "scale(0)");
            })
        })
    </script>


</body>
</html>
